package com.per.mybootall.test;

import cn.hutool.core.date.DateUnit;
import com.alibaba.fastjson.JSON;
import org.apache.avro.data.Json;

import java.beans.SimpleBeanInfo;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: yyy
 * Date: 2022/2/23
 * Time: 10:09
 * Description:时间戳转化
 */
public class test15 {
  public static void main(String[] args) throws ParseException {
    //SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd");
    //System.out.println(cn.hutool.core.date.DateUtil.endOfMonth(sdf.parse("2022-03-21")));
    //sdf.parse("2022-04-01");
    //cn.hutool.core.date.DateUtil.between(sdf.parse("2022-04-01"),sdf.parse("2022-04-11"), DateUnit.DAY);
    //System.out.println(0L+cn.hutool.core.date.DateUtil.between(sdf.parse("2022-06-01"),sdf.parse("2022-06-10"), DateUnit.DAY));

//    BigDecimal big=new BigDecimal(10.90);
//    BigDecimal small=new BigDecimal(6.45);
//    BigDecimal result=big.subtract(small);
//    System.out.println(result);  2022-03-04 02:30:00


//    2022-04-01 02:30:00-----1648751400000        2022-05-01 02:30:00-----1651343400000       2022-06-01 02:30:00-----1654021800000     2022-07-01 02:30:00-----1656613800000
//    2022-04-02 02:30:00-----1648837800000        2022-05-02 02:30:00-----1651429800000       2022-06-02 02:30:00-----1654108200000     2022-07-02 02:30:00-----1656700200000

//    2022-08-01 02:30:00-----1659292200000        2022-09-01 02:30:00-----1661970600000       2022-10-01 02:30:00-----1664562600000     2022-11-01 02:30:00-----1667241000000
//    2022-08-02 02:30:00-----1659378600000        2022-09-02 02:30:00-----1662057000000       2022-10-02 02:30:00-----1664649000000     2022-11-02 02:30:00-----1667327400000

//    2022-12-01 02:30:00-----1669833000000    2023-01-01 02:30:00-----1672511400000
////    2022-12-02 02:30:00-----1669919400000    2023-01-02 02:30:00-----1672597800000
//    Date date2 = new Date(Long.parseLong("202205091619595"));
//    Date date1 = new Date(Long.parseLong("1651775400000"));
//
//    SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//
//    System.out.println("date1:"+sdf.format(date1));
//    System.out.println("date2:"+sdf.format(date2));
//
//    System.out.println("2022-05-01 02:30:00-----"+sdf.parse("2022-05-01 02:30:00").getTime());
//    System.out.println("2022-04-30 02:30:00-----"+sdf.parse("2022-04-30 02:30:00").getTime());
//
//    SimpleDateFormat sdf2 = new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS");
//
//    BigInteger a=new BigInteger("10");
//  BigInteger b=new BigInteger("3");


//    List<String> asd01=new ArrayList(){{add("1");add("2");add("3");add("4");add("5");add("6");add("7");add("8");add("9");add("1");add("4");add("7");}};
//    List<String> asd02=new ArrayList<>();
//    for(String str01:asd01){
//      boolean isTrue=true;
//      for(String str02:asd02){
//        if(str01.equals(str02)){
//          isTrue=false;
//        }
//      }
//     if(isTrue) asd02.add(str01);
//      System.out.println(JSON.toJSONString(asd02));
//    }


    SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmssSSS");
    String createTime=sdf.format(new Date());
    String finalTmpl;
for(int j=0;j<100;j++){

  Random random=new Random();
  String tmpl=String.valueOf(random.nextInt(1000));

  if(tmpl.length()<=4){
    int strSize=4-tmpl.length();
    for(int i=0;i<strSize;i++){
      tmpl="0"+tmpl;
    }

  }
  finalTmpl=createTime+tmpl;
  System.out.print(tmpl+"      ");
}



    System.out.println(createTime+"      ");
  }
}
